;(function(){

	window.requestAnimationFrame	=	window.requestAnimationFrame
									||	window.webkitRequestAnimationFrame
									||	window.mozRequestAnimationFrame;

	window.cancelAnimationFrame		=	window.cancelAnimationFrame
									||	window.webkitCancelAnimationFrame
									|| 	window.mozCancelAnimationFrame
									|| 	window.cancelRequestAnimationFrame
									|| 	window.webkitCancelRequestAnimationFrame
									||	window.mozCancelRequestAnimationFrame;

	//当浏览器不支持 requestAnimationFrame 或者 cancelAnimationFrame 时，使用setTimeout/clearTimeout做兼容处理
	;(function(){
		if(!requestAnimationFrame){
			var lastTime = Date.now();
			window.requestAnimationFrame = function(callback){
				var nowTime = Date.now();
				var delay = Math.max(16.7 - (nowTime - lastTime),0);
				var id = setTimeout(callback,delay);
				lastTime = nowTime + delay;

				return id;

			}
		}


		if(!cancelAnimationFrame){
			window.cancelAnimationFrame = function(id){
				clearTimeout(id);
			}
		}

	})();




})();
